<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>市场信息表-目的地运营集团数据管理平台</title>
<include file="Include:style" />
</head>
<body>
<include file="Include:header" />
<include file="Include:left" />
<div id="main">
	<div class="crumbs">
		<div class="crumbs-text">市场信息表</div>
		<div class="right">
			<div class="input-group left w200">
		    	<input type="text" id="keyword" value="{$keyword}" class="form-control" placeholder="按市场信息编号/名称搜索" autocomplete="off">
	    		<span class="input-group-btn">
	        		<button class="btn found_btn" type="button">搜索</button>
		    	</span>
		    </div>
			<if condition="get_permission('SC',1,1)">
				<a href="__APP__/System/label_administration_three/classif/16,17/types/市场信息" class="btn left ml5" target="_blank">标签管理</a>
			</if>
			<if condition="is_permission('SC',NULL,1)">
				<a href="__APP__/Project/customer_information_add/center_id/{$center_id}" class="btn left ml5">添加市场信息</a>
			</if>
		</div>
	</div>
	<div id="content">
		<div class="table-scrollx">
			<table class="table table-bordered table-hover">
				<tr class="table-header fixed-table-header">
					<td width="">市场信息编号</td>
					<td width="">市场信息名称</td>
					<td width="">商务跟进项目编号</td>
					<td width="">
						<select name="channel" class="form-control" style="width:120px;">
							<option value="-1" <if condition="-1 eq $channel">selected</if>>获悉渠道</option>
							<foreach name="channels[0]['second'][0]['third']" item="co">
								<option value="{$co['id']}" <if condition="$channel eq $co['id']">selected</if>>{$co['third_name']}</option>
							</foreach>
						</select>
					</td>
					<td width="">市场信息类型</td>
					<td>启动日期</td>
					<td>
						<select name="effective" style="width:100px;">
							<option value="0" <if condition="0 eq $effective">selected</if>>有效性</option>
							<option value="1" <if condition="'1' eq $effective">selected</if>>是</option>
							<option value="-1" <if condition="'-1' eq $effective">selected</if>>否</option>
						</select>
					</td>
					<if condition="is_permission('SC',NULL,1)">
						<td width="">管理</td>
					</if>
				</tr>
				<if condition="$result eq NULL">
				<tr>
					<td <if condition="is_permission('SC',NULL,1)">colspan="8"<else />colspan="7"</if> class="text-center">暂无相关内容</td>
				</tr>
				</if>
				<foreach name="result" item="vo">
				<tr>
					<td><a href="__APP__/Project/customer_information_detail/id/{$vo['id']}">{$vo['customer_num']}</a></td>
					<td>{$vo['customer_name']}</td>
					<td><a href="__APP__/Project/project_situation/id/{$vo['stage']['id']}" target="_blank">{$vo['stage']['project_num']}</a></td>
					<td>{$vo['channelss']}</td>
					<td>
						<foreach name="vo['type']" item="f" key="k">
							<if condition="$k neq 0">
								</br>{$f['second_name']}——{$f['third_name']}
							<else/>
								{$f['second_name']}——{$f['third_name']}
							</if>
						</foreach>
					</td>
					<td>{$vo['start_date']}</td>
					<td><if condition="$vo['effective'] eq 1">是<else/>否</if></td>
					<if condition="is_permission('SC',NULL,1)">
					<td class="nowrap">
						<if condition="((get_permission('SC',NULL,3)) and ($vo['add_uid'] eq $login_id)) or (get_permission('SC',NULL,2) and strstr($vo['center_id'],$login_center_id)) or (get_permission('SC',NULL,1))">
							<a href="__APP__/Project/customer_information_edit/center_id/{$center_id}/keyword/{$keyword}/channel/{$channel}/effective/{$effective}/id/{$vo['id']}" data-toggle="tooltip" data-placement="left" title="编辑" class="mr5"><i class="glyphicon glyphicon-edit"></i></a>
							<if condition="$vo['stage_id'] eq NULL">
							<a href="javascript:;" class="delete" action="delete" data-toggle="tooltip" data-placement="left" title="删除" mid="{$vo['id']}"><i class="glyphicon glyphicon-trash"></i></a>
							</if>
						</if>
					</td>
					</if>
				</tr>
				</foreach>
			</table>
		</div>
		<div class="pages">{$page}</div>
	</div>
</div>
<include file="Include:javascript" />
<script type="text/javascript">
$(function(){
	//删除
	$(".delete").ajaxModal({"title_text":"确认提示框","body_text":"您确定要删除吗？","url":"__APP__/Project/customer_information_ajax","data":{"id":"mid","action":"action"}});
	//搜索
	$(".found_btn").keywordSearch("__APP__/Project/customer_information/center_id/{$center_id}/keyword/$keyword/channel/{$channel}/effective/{$effective}");
	
	$(document).on("change","[name='channel']",function(){
		var val = $(this).val();
		window.location.href="__APP__/Project/customer_information/center_id/{$center_id}/keyword/{$keyword}/channel/"+val+"/effective/{$effective}";
	});
	
	$(document).on("change","[name='effective']",function(){
		var val = $(this).val();
		window.location.href="__APP__/Project/customer_information/center_id/{$center_id}/keyword/{$keyword}/channel/{$channel}/effective/"+val;
	});
});
</script>
</body>
</html>